import request from '@/utils/request'

// 获取客户列表
export function getClientList(params) {
  return request.get('/clients', { params })
}

// 获取全部经纪人
export function getBroker() {
  return request.get('/agents')
}

// 获取客户数量
export function getClientTotal(params) {
  return request.get('/clients/count', { params })
}

// 新增客户
export function addClient(data) {
  return request.post('/clients', data)
}

// 删除客户
export function delClient(id) {
  return request.delete(`/clients/${id}`)
}

// 根据id进行获取客户
export function getChilentById(id) {
  return request.get(`/clients/${id}`)
}

// 编辑客户
export function editClient(data) {
  return request.put(`/clients/${data.id}`, data)
}
